﻿using System;
using System.Threading;
using System.Windows.Input;

namespace Mido.Utils.Mvvm
{
    public class SimpleCommand : ICommand 
    {
        public event EventHandler CanExecuteChanged;

        private readonly ThreadStart _method;

        public SimpleCommand(ThreadStart method)
        {
            if (method == null) 
                throw new ArgumentNullException("method");

            _method = method;
        }

        public void Execute(object parameter)
        {
            _method();
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        
    }
}
